<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- <form action=""> -->
    <input type="file" id="files" multiple/>
    <input type="text" name="name" value="boxue">
    <input type="text" name="password" value="qeqweqew">
    <input type="submit" value="提交" onclick="sfdfsfsdf()">
  <!-- </form> -->
  <script>
    function sfdfsfsdf() {
      var formData = new FormData()
      formData.append('password', document.querySelector('input[name="password"]').value)
      formData.append('name', document.querySelector('input[name="name"]').value)

      let files = document.getElementById('files').files;
      for (var i = 0; i < files.length; i++) {
        console.log(`formData.html 23`,files[i].name);
        formData.append('files', files[i],files[i].name)
      }

      for (var value of formData.values()) {
        console.log(value);
      }
    }
  </script>
</body>
</html>